package com.example.testtouch2;

import com.demo.androidgame.fx.Music;
import com.demo.androidgame.fx.Pixmap;
import com.demo.androidgame.fx.Sound;
import com.demo.androidgame.fx.gl.Animation;
import com.demo.androidgame.fx.gl.Font;
import com.demo.androidgame.fx.gl.Texture;
import com.demo.androidgame.fx.gl.TextureRegion;
import com.demo.androidgame.fx.impl.GLGame;

public class Assets {
	
	public static Texture background, background2, background3, background4, background0, gamedescription, level2, level3, level4;
    public static TextureRegion backgroundRegion, backgroundRegion2, backgroundRegion3, backgroundRegion4, background0Region, gamedescriptionRegion;
    
    public static Texture atlas, items, atlasfont, present, back, scoreback, score320;
    public static Texture amazon0, amazon1, amazon2, amazon3, amazon4, amazon5, amazon6;
    public static TextureRegion amazon0R, amazon1R, amazon2R, amazon3R, amazon4R, amazon5R, amazon6R;
    
    public static TextureRegion smile;
    public static TextureRegion highscore;
    public static TextureRegion highpoint;
    public static TextureRegion nfcversion;
    public static TextureRegion backRegion, highScoresRegion;
    public static TextureRegion playerRegion;
    public static TextureRegion coin;
    public static TextureRegion goMenu;
    public static TextureRegion mainMenu1, mainMenu2, mainMenu3;
    public static TextureRegion level1, level2start, level3start, level4start;
    public static TextureRegion timer, score, point0;
    public static TextureRegion gameover;
    public static Animation coinAnim;
	public static Animation enemy1 , enemy2, camel, dolphin;
    public static TextureRegion present1, present2, present3, present4;
    public static TextureRegion scorebackRegion;
    
    public static Pixmap numbers;
    
    public static Font font, font2, font3;
    
    public static Music music;
    public static Sound GetSound;
    public static Sound SendSound;
    public static Sound GameOverSound;
    public static Sound coinSound, amazonSound, collisionSound;
    
    public static void load(GLGame game) {
        background = new Texture(game, "level1.png");
        backgroundRegion = new TextureRegion(background, 0, 0, 720, 1280);

        background2 = new Texture(game, "level2.png");
        backgroundRegion2 = new TextureRegion(background2, 0, 0, 720, 1280);
        background3 = new Texture(game, "level3.png");
        backgroundRegion3 = new TextureRegion(background3, 0, 0, 720, 1280);
        background4 = new Texture(game, "level4.png");
        backgroundRegion4 = new TextureRegion(background4, 0, 0, 720, 1280);
        
        
        background0 = new Texture(game, "background2.png");
        background0Region = new TextureRegion(background0, 0, 0, 720, 1280);
        
        scoreback = new Texture(game, "scoreback.png");
        scorebackRegion = new TextureRegion(scoreback, 0 , 0, 720, 1280);
        
        gamedescription = new Texture(game, "description.png");
        gamedescriptionRegion = new TextureRegion(gamedescription, 0, 0, 720, 1280);
        
        back = new Texture(game, "back.png");
        backRegion = new TextureRegion(back, 0, 0, 720, 1280);
        score320 = new Texture(game, "320480.png");
        highScoresRegion = new TextureRegion(Assets.score320, 0, 257, 300, 110 / 3);
        
        atlas = new Texture(game, "assets-atlas.png");
        smile = new TextureRegion(atlas, 946, 870, 120, 120);
        highscore = new TextureRegion(atlas, 1080, 1000, 150, 66);
        highpoint = new TextureRegion(atlas, 1250, 1000, 150, 66);
        
        enemy1 = new Animation(0.18f,
        		new TextureRegion(atlas, 0, 324, 72, 36), 
				new TextureRegion(atlas, 72, 324, 86, 36), 
				new TextureRegion(atlas, 207, 324, 81, 36), 
				new TextureRegion(atlas, 288, 324, 75, 36), 
				new TextureRegion(atlas, 207, 324, 81, 36), 
				new TextureRegion(atlas, 72, 324, 86, 36), 
				new TextureRegion(atlas, 0, 324, 72, 36));
        enemy2 = new Animation(0.18f,
				new TextureRegion(atlas, 14, 356, 190, 72), 
				new TextureRegion(atlas, 224, 356, 190, 72), 
				new TextureRegion(atlas, 435, 356, 190, 72), 
				new TextureRegion(atlas, 635, 356, 190, 72), 
				new TextureRegion(atlas, 435, 356, 190, 72),
				new TextureRegion(atlas, 224, 356, 190, 72), 
				new TextureRegion(atlas, 14, 356, 190, 72));
        
        camel = new Animation(0.15f,
        		new TextureRegion(atlas, 216, 0, 144, 72),
        		new TextureRegion(atlas, 360, 0, 144, 72),
        		new TextureRegion(atlas, 504, 0, 144, 72),
        		new TextureRegion(atlas, 648, 0, 144, 72),
        		new TextureRegion(atlas, 792, 0, 144, 72),
        		new TextureRegion(atlas, 648, 0, 144, 72),
        		new TextureRegion(atlas, 504, 0, 144, 72),
        		new TextureRegion(atlas, 360, 0, 144, 72));

  
       
        playerRegion = new TextureRegion(atlas, 0, 66, 72, 71);
        mainMenu1 = new TextureRegion(atlas, 0, 1066, 432, 71);
        mainMenu2 = new TextureRegion(atlas, 0, 1138, 432, 71);
        mainMenu3 = new TextureRegion(atlas, 504, 1138, 934-504, 71);
        level1 = new TextureRegion(atlas, 504, 996, 216, 71);
        level2start = new TextureRegion(atlas, 792, 996, 216, 71);
        level3start = new TextureRegion(atlas, 504, 1068, 216, 71);
        level4start = new TextureRegion(atlas, 792, 1068, 216, 71);
        score = new TextureRegion(atlas, 720, 854, 180, 70);
        timer = new TextureRegion(atlas, 720, 926, 180, 70);
        point0 = new TextureRegion(atlas, 1084, 1072, 1238-1080, 71);
        gameover = new TextureRegion(atlas, 0, 1002, 432, 71);
        goMenu = new TextureRegion(atlas, 689, 1200, 255, 80);
        coin = new TextureRegion(atlas, 1008, 1138, 432, 71);
        nfcversion = new TextureRegion(atlas, 1080, 1220, 360, 80);
        
        present = new Texture(game, "present.png");
        present1 = new TextureRegion(present, 0, 0, 72, 72);
        present2 = new TextureRegion(present, 144, 0, 72, 72);
        present3 = new TextureRegion(present, 288, 0, 72, 72);
        present4 = new TextureRegion(present, 432, 0, 72, 72);
        
       
        items = new Texture(game, "items.png");
        
        font = new Font(items, 0, 0, 16, 41, 51);
        font2 = new Font(items, 0, 320, 16, 41, 51);
        font3 = new Font(score320, 224, 0, 16, 16, 20);
 
        coinAnim = new Animation(0.1f,                                 
                new TextureRegion(atlas, 1008, 1138, 72, 72),
                new TextureRegion(atlas, 1080, 1138, 72, 72),
                new TextureRegion(atlas, 1152, 1138, 72, 72),
                new TextureRegion(atlas, 1224, 1138, 72, 72),
                new TextureRegion(atlas, 1296, 1138, 72, 72),
                new TextureRegion(atlas, 1368, 1138, 72, 72),
                new TextureRegion(atlas, 1296, 1138, 72, 72),
                new TextureRegion(atlas, 1224, 1138, 72, 72),
                new TextureRegion(atlas, 1152, 1138, 72, 72),
                new TextureRegion(atlas, 1080, 1138, 72, 72));
        
        		amazon0 = new Texture(game, "amazon0.png");
        		amazon0R = new TextureRegion(amazon0, 0, 0, 700, 220);
        		
        		amazon1 = new Texture(game, "amazon1.png");
        		amazon1R = new TextureRegion(amazon1, 0, 0, 700, 220);
        		
        		amazon2 = new Texture(game, "amazon2.png");
        		amazon2R = new TextureRegion(amazon2, 0, 0, 700, 220);
        		
        		amazon3 = new Texture(game, "amazon3.png");
        		amazon3R = new TextureRegion(amazon3, 0, 0, 700, 220);
        		
        		amazon4 = new Texture(game, "amazon4.png");
        		amazon4R = new TextureRegion(amazon4, 0, 0, 700, 220);
        		
        		amazon5 = new Texture(game, "amazon5.png");
        		amazon5R = new TextureRegion(amazon5, 0, 0, 700, 220);
        		
        		amazon6 = new Texture(game, "amazon6.png");
        		amazon6R = new TextureRegion(amazon6, 0, 0, 700, 220);
             
        music = game.getAudio().newMusic("mission.ogg");
        music.setLooping(true);
        music.setVolume(1.0f);
        if(Settings.soundEnabled){
            music.play();
            music.stop();
            music.pause();}
        
        GetSound = game.getAudio().newSound("get.ogg");
        SendSound = game.getAudio().newSound("send.ogg");
        GameOverSound = game.getAudio().newSound("gameover.ogg");
        coinSound = game.getAudio().newSound("coin.ogg");
        amazonSound = game.getAudio().newSound("amazon.ogg");
        collisionSound = game.getAudio().newSound("collision.ogg");
    }       
    
    public static void reload() {
    	background0.reload();
        background.reload();
        atlas.reload();
        items.reload();
        amazon0.reload();
        amazon1.reload();
        amazon2.reload();
        amazon3.reload();
        amazon4.reload();
        amazon5.reload();
        amazon6.reload();
  
    }
}
